package com.lcx.plugin.tool;

import com.intellij.openapi.project.Project;
import com.lcx.plugin.dto.DbConfigDTO;
import lombok.Data;

/**
 * 缓存数据工具类
 *
 * @author daxiong
 * @date 2023/6/21 上午10:22
 */
@Data
public class CacheDataUtils {
    private volatile static CacheDataUtils cacheDataUtils;

    /**
     * 单例模式
     */
    public static CacheDataUtils getInstance() {
        if (cacheDataUtils == null) {
            synchronized (CacheDataUtils.class) {
                if (cacheDataUtils == null) {
                    cacheDataUtils = new CacheDataUtils();
                }
            }
        }
        return cacheDataUtils;
    }

    private CacheDataUtils() {
    }

    /**
     * 当前的db配置
     */
    private DbConfigDTO dbConfig;

    private Project project;

    private String selectFilePath;

    private boolean tableExistJump;

    /**
     * 生成的sql是否直接复制到剪切板，不通过jdbc进行执行
     */
    private boolean sql2Clipboard;
}
